import {Map,List} from 'immutable'
import {LOADLIST,LOADSHOES,LOADCLOTHES} from './actionType'

const defaultState=Map({
    list:List([]),
    shoes:List([]),
    clothes:List([])
})

export default (state=defaultState,action)=>{
    switch(action.type){
        case LOADLIST:
            // console.log(100);
            return state.updateIn(['list'],()=>action.list)
            // return state.get('list').push([...action.list])
        case LOADSHOES:
            return state.updateIn(['shoes'],()=>action.shoes)
        case LOADCLOTHES:
            return state.updateIn(['clothes'],()=>action.clothes)
        default:
            return state
    }
}